package com.gouda.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 大力 on 2015/12/8.
 */
public enum EnumDefault {
    IS(1, "is"),
    NOT(0, "not")
    ;

    private int code;
    private String msg;

    private EnumDefault(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private static final Map<Integer, EnumAuditState> interToEnum = new HashMap<Integer, EnumAuditState>();

    static {
        for (EnumAuditState type : EnumAuditState.values()) {
            interToEnum.put(type.getCode(), type);
        }
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static EnumAuditState fromInteger(int code) {
        return interToEnum.get(code);
    }
}
